package com.workingpub.commons.jdbc;

import com.workingpub.commons.jdbc.binding.SqlDefineEntry;
import com.workingpub.commons.jdbc.binding.SqlMapping;

/**
 * SQLMapping上下文，存取和缓存SqlMapping
 * 
 * @author taoping
 *
 */
public interface SqlDefineContext {

	static final String Default_Domain_Group = "_Default_Domain_Group_";

	void addSqlDefines(SqlDefineEntry sqlDefines);

	void removeSqlDefines(SqlDefineEntry sqlDefines);

	/**
	 * 
	 * @param sqlMapping
	 * @param databaseCode
	 *            if null or empty, add to default group
	 */
	void addSqlMapping(SqlMapping sqlMapping, String databaseCode);

	void removeSqlMapping(String sqlId, String databaseCode);

	SqlMapping getSqlMapping(String sqlId);

	SqlMapping getSqlMapping(String sqlId, String domainCode);

	int getSqlMappingSize();

	int getSqlMappingSize(String domainCode);
}
